package com.phpxiu.app.model.msg;

import android.text.Editable;

import com.tencent.TIMMessage;
import com.tencent.TIMTextElem;

/**
 * Created by 吴金洲 on 2016/7/26
 */
public class C2CTextMsg extends C2CMsg {
    public C2CTextMsg(TIMMessage message){
        this.message = message;
    }

    public C2CTextMsg(String s){
        message = new TIMMessage();
        TIMTextElem elem = new TIMTextElem();
        elem.setText(s);
        message.addElement(elem);
    }

    public C2CTextMsg(Editable s){
        message = new TIMMessage();
        int currentIndex = 0;
        if (currentIndex < s.length()){
            TIMTextElem textElem = new TIMTextElem();
            textElem.setText(s.subSequence(currentIndex, s.length()).toString());
            message.addElement(textElem);
        }
    }
}
